<template>
	<view>
		<view class="top-img">
			<image :src="detailData.picShowUrl" mode="aspectFill"></image>
		</view>
		<view class="name-view">
			<view class="name">{{detailData.name}}</view>
			<view class="money">￥{{detailData.price}} /月</view>
		</view>
		<view class="details-view">
			<view class="details-view-div">服务详情</view>
			<view class="info-row">
				<view v-html="detailData.description"></view>
			</view>
		</view>
		<view class="fixed-view">
			<view class="op-btn">
				<uni-icons type="phone-filled" size="25"></uni-icons>
				电话
			</view>
			<view class="op-btn">
				<uni-icons type="location-filled" size="25"></uni-icons>
				地址
			</view>
			<view class="btn" @click="navToOrder">立即预约</view>
		</view>
	</view>
</template>

<script>
	import * as assistDev from '../../common/api/assistDev.js'
	export default {
		data() {
			return {
				uid:'',
				detailData:{}
			}
		},
		onLoad(opt) {
			if(opt.uid){
				this.uid = opt.uid
			}
		},
		onShow() {
			this.getData()
		},
		methods: {
			getData(){
				const param = {
					uid:this.uid
				}
				assistDev.queryByUid(param).then(result => {
					this.detailData = result.data.data || {}
				}).catch(error => {
					console.log(error);
				})
			},
			navToOrder(){
				uni.navigateTo({
					url:"/accessoryRentalPages/pages/order/order?uid="+this.uid
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.top-img{
	width: 100%;
	height: 350rpx;
	image{
		width: 100%;
		height: 350rpx;
	}
}
.name-view{
	width: 100%;
	display: flex;
	flex-direction: column;
	padding: 30rpx;
	box-sizing: border-box;
	.name{
		font-size: 40rpx;
		font-weight: bold;
	}
	.money{
		color: #17C5C5;
		font-size: 40rpx;
		font-weight: bold;
		margin-top: 10rpx;
	}
}

.details-view{
	width: 100%;
	padding: 30rpx;
	box-sizing: border-box;
	.details-view-div{
		padding: 10rpx 0;
		border-bottom: solid 1rpx rgba(214, 214, 214,0.6);
	}
	.info-row{
		margin-top: 20rpx;
		.title{
			font-weight:bold;
			margin-bottom: 10rpx;
		}
	}
}
.fixed-view{
	position: fixed;
	bottom: 0;
	width: 100%;
	padding: 5rpx 30rpx;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	border-top: solid 1rpx rgba(214, 214, 214,0.6);
	background: white;
	.op-btn{
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		padding: 10rpx;
	}
	.btn{
		flex: 1;
		background: #F05F10;
		height: 80rpx;
		border-radius: 40rpx;
		color: white;
		display: flex;
		align-items: center;
		justify-content: center;
		margin-left: 20rpx;
	}
}
</style>
